package ie.dkit.java3Demulation.objects3d;

import java.util.ArrayList;
import java.util.Collection;

import ie.dkit.java3Demulation.drawer.Line3DDrawable;
import ie.dkit.java3Demulation.transforming.Transformable;

public class Pyramide implements Line3DDrawable, Transformable {

	private String name;

	private Point3D peak;

	private Point3D leftBottom;

	private Point3D rightBottom;

	private Point3D behindBottom;

	private Point3D rotationPoint;

	public Pyramide() {
		name = "Pyramide";
		peak = new Point3D(0, 100, 0);
		peak.setName("peak");
		leftBottom = new Point3D(-100, 0, 100);
		leftBottom.setName("leftBottom");
		rightBottom = new Point3D(100, 0, 100);
		rightBottom.setName("rightBottom");
		behindBottom = new Point3D(0, 0, -100);
		behindBottom.setName("behindBottom");
	}

	public Pyramide(Point3D peak, Point3D leftBottom, Point3D rightBottom,
			Point3D behindBottom) {
		super();
		this.peak = peak;
		this.leftBottom = leftBottom;
		this.rightBottom = rightBottom;
		this.behindBottom = behindBottom;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.drawer.LineDrawable#getLines()
	 */
	public Collection<Line3D> getLines() {
		Collection<Line3D> returnValue = new ArrayList<Line3D>();
		returnValue.add(new Line3D(peak, leftBottom));
		returnValue.add(new Line3D(peak, rightBottom));
		returnValue.add(new Line3D(peak, behindBottom));
		returnValue.add(new Line3D(leftBottom, rightBottom));
		returnValue.add(new Line3D(leftBottom, behindBottom));
		returnValue.add(new Line3D(rightBottom, behindBottom));
		return returnValue;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#getName()
	 */
	public String getName() {
		return name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#setName(java.lang.String)
	 */
	public void setName(String name) {
		this.name = name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.transforming.Transformable#getPoints()
	 */
	public Collection<Point3D> getPoints() {
		Collection<Point3D> returnValue = new ArrayList<Point3D>();
		returnValue.add(peak);
		returnValue.add(leftBottom);
		returnValue.add(rightBottom);
		returnValue.add(behindBottom);
		return returnValue;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.transforming.Transformable#getRotationPoint()
	 */
	public Point3D getRotationPoint() {
		return rotationPoint;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.transforming.Transformable#setRotationPoint(ie.dkit.java3Demulation.objects3d.Point3D)
	 */
	public void setRotationPoint(Point3D point3D) {
		rotationPoint = point3D;
	}

	public Point3D getBehindBottom() {
		return behindBottom;
	}

	public void setBehindBottom(Point3D behindBottom) {
		this.behindBottom = behindBottom;
	}

	public Point3D getLeftBottom() {
		return leftBottom;
	}

	public void setLeftBottom(Point3D leftBottom) {
		this.leftBottom = leftBottom;
	}

	public Point3D getPeak() {
		return peak;
	}

	public void setPeak(Point3D peak) {
		this.peak = peak;
	}

	public Point3D getRightBottom() {
		return rightBottom;
	}

	public void setRightBottom(Point3D rightBottom) {
		this.rightBottom = rightBottom;
	}

}
